package greetings

import "time"

func GoodDay(name string) string {
	return "Good Day " + name
}

func GoodNight(name string) string {
	return "Good Night " + name
}

func IsAm() bool {
	now := time.Now()
	return now.Hour() <= 12
}

func IsAfternoon() bool {
	now := time.Now()
	hour := now.Hour()
	return hour > 12 && hour <= 18
}

func IsEvening() bool {
	now := time.Now()
	hour := now.Hour()
	return hour > 18 && hour < 22
}

func Greeting(name string) string {
	if IsAm() || IsAfternoon() {
		return GoodDay(name)
	}
	if IsEvening() {
		return GoodNight(name)
	}
	return "Go bed hurry up!" + name
}
